﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Parser;

namespace SqlFormatter
{
    public partial class SqlFormatterForm : Form
    {
        public SqlFormatterForm()
        {
            InitializeComponent();
        }

        private void btnFormat_Click(object sender, EventArgs e)
        {
            SqlParser parser = new SqlParser();
            parser.Parse(tbOrig.Text);
            tbAfter.Text = parser.FieldsClause;

            SqlFormatter formatter = new SqlFormatter(tbOrig.Text);
            tbAfter.Text = formatter.ToString();
        }
    }
}
